<template>
	<view>
		<view class="nav" :style="{'height':navBarHeight+'px'}">
			<!-- 胶囊区域 -->
			<view class="status-box" :style="{'height':statusBarH+'px'}"></view>
			<view class="nav-handle-box" :style="{'height':navBarHeight-statusBarH+'px'}">
				<view class="left-box" :style="{'width':leftWidth+'px'}">
					<slot name="left"></slot>
				</view>
				<view class="mid-box">
					<slot name="mid"></slot>
				</view>
				<view class="right-box" :style="{'width':rightWidth+'px'}">
					<slot name="right"></slot>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		mapState,
		mapGetters
	} from 'vuex'
	export default {
		name: "nav-bar",
		props: {
			leftWidth: {
				type: [Number, String],
				default: 60
			},
			rightWidth: {
				type: [Number, String],
				default: 60
			}
		},
		computed: {
			...mapState('pb_Prototype', ['statusBarH', 'customBarH', 'paddingTop', 'paddingButtom', 'menuHeight',
				'windowWidth', 'menuleft'
			]),
			...mapGetters('pb_Prototype', ['navBarHeight', 'menuBotton'])
		},
		data() {
			return {

			};
		},
		methods: {
			back() {
				uni.navigateBack()
			},
			leftIconWidth() {
				return this.leftWidth
			},
			rightIconWidth() {
				return this.rightWidth
			}
		}
	}
</script>

<style lang="scss">
	.nav {

		.status-box {}

		.nav-handle-box {
			display: flex;
			justify-content: space-between;
			
			align-items: center;
			.left-box{
				padding-left: 10px;
			}
			
			
		}

	}
</style>